package com.zjl.servlet;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Scanner;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zjl.dao.impl.StudentDaoImpl;
import com.zjl.entity.StudentEntity;
import com.zjl.util.BaseServlet;

import com.zjl.util.DBManager;
import com.zjl.util.QueryDataResult;

/**
 * Servlet implementation class UserServlet2
 */
public class StudentServlet extends BaseServlet{
	private static final long serialVersionUID = 1L;
       
	StudentDaoImpl dao=new StudentDaoImpl();
	public void selectAll(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
		// 1 那参数
		String name = request.getParameter("name");
		ArrayList<StudentEntity> arrayList = dao.selectAll(name);
		request.setAttribute("alist", arrayList);
		request.setAttribute("name",name);
		request.getRequestDispatcher("list.jsp").forward(request, response);
	}
	
}
